//
// Created by 32827 on 2024/1/10.
//

#ifndef STM32OSCOVER_YZL_SOFTPORT_H
#define STM32OSCOVER_YZL_SOFTPORT_H
#include "yz.h"
#include "yzl_conf.h"
// #include "yzl_clock.h"
#if YZ_HAL
typedef struct{
    uint16_t pin;
    GPIO_TypeDef *port;
}YZL_GPIO;
#else
typedef struct{
    uint32_t pin;
    uint32_t port;
}YZL_GPIO;
#endif
#define YLGPIO(x) YGPIO(x.port)YPIN(x.pin)
#define YLHIGH(x) yzf_gpio_set_1(x.port,x.pin)
#define YLLOW(x) yzf_gpio_set_0(x.port,x.pin)

void yzl_softport_delayUS (__IO uint32_t ulCount);
void yzl_softport_delayMS (__IO uint32_t ulCount);

///@deprecated
#define delay_ms(x) yzl_softport_delayMS(x)
#define delay_us(x) yzl_softport_delayUS(x)
// #define delay_ms(x) yzl_clock_delay_ms(x)
// #define delay_us(x) yzl_clock_delay_us(x)
#endif //STM32OSCOVER_YZL_SOFTPORT_H
